<?php
require_once 'defs/constants.php';
include_once DIR_CLASSES.'measure_type.php';
include_once DIR_CLASSES.'status_volgnummer.php';


	
if ( isset($_POST) && isset($_POST['action']) ){
    
    // switch
    switch ($_POST['action']){
		/* new prestatie */
        case 'new_prestatie' :
            $prestatie = new StatusVolgnummer();
            $prestatie->setName($_POST['status']);
            $prestatie->setDescription($_POST['status_desc']);
            $prestatie->save();
            break;
        /* new vermogens*/
        case 'new_vermogen' :
            $vermogen = new MeasureType();
            $vermogen->setName($_POST['meting']);
            $vermogen->setDescription($_POST['meting_desc']);
            $vermogen->save();
            break;
}
}

?>

<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Highcharts Example</title>

		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
		<script type="text/javascript">
$(function () {
    var chart;
    $(document).ready(function() {
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                type: 'bar'
            },
            title: {
                text: 'Meten Van leerwinst'
            },
            subtitle: {
                text: 'Source: Exelsheet'
            },
            xAxis: {
                categories: ['A', 'B', 'C', 'D', 'E'],
                title: {
                    text: 'Context'
                }
            },
            yAxis: {
				minTickInterval : 1,
				max : 4,
                title: {
                    text: 'Niveau',
                    align: 'high'
                },
                labels: {
                    overflow: 'justify'
                }
            },
            tooltip: {
                formatter: function() {
                    return ''+
                        this.series.name +': '+ this.y +' niveau';
                }
            },
            plotOptions: {
                bar: {
                    dataLabels: {
                        enabled: true
                    }
                }
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'top',
                x: -100,
                y: 100,
                floating: true,
                borderWidth: 1,
                backgroundColor: '#FFFFFF',
                shadow: true
            },
            credits: {
                enabled: false
            },
            series: [{
                name: 'Uitvoeren',
				color: '#0000ff',
                data: [1, 2, 3, 4, 2]
            }, {
                name: 'Bijsturen',
				color: '#ff6600',
                data: [1, 2, 3, 4, 1]
            }, {
                name: 'Organiseren',
				color: '#ccffff',
                data: [1, 2, 3, 4, 3]
            }, {
                name: 'Communiceren',
				color: '#ffff00',
                data: [1, 2, 3, 4, 4]
            }, {
                name: 'Verantwoorden',
				color: '#00ff00',
                data: [1, 2, 3, 4, 1]
            }]
        });
    });
    
});
		</script>
	</head>
	<body>
<script src="js/highcharts.js"></script>

<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>

	</body>
</html>
